package com.lancoo.ccas53.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lancoo.ccas53.entity.Course;
import com.lancoo.ccas53.entity.PlanTeaching;
import com.lancoo.ccas53.entity.TeachingClass;
import com.lancoo.ccas53.pojo.common.PageInfo;
import com.lancoo.ccas53.pojo.dto.SetCourseDto;
import com.lancoo.ccas53.pojo.vo.CourseInput;
import com.lancoo.ccas53.pojo.vo.CourseParameterSetVo;
import com.lancoo.ccas53.pojo.vo.CourseTreeVo;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Optional;
import java.util.Set;

/**
 * <p>
 * 课程环节表 服务类
 * </p>
 *
 * @author quin.song
 * @since 2024-05-20
 */
public interface CourseService extends IService<Course> {

    /**
     * 同步课程库数据
     *
     * @param taskId
     * @param schoolId
     */
    void syncBaseCourse(Integer taskId, String schoolId);

    /**
     * 更新课程表数据
     *
     * @param taskId
     * @param courses
     */
    void syncCourse(Integer taskId, Set<Course> courses);

    void syncPlanCourse(Integer taskId, Set<Course> courses);


    /**
     * 获取课程列表
     *
     * @param taskId
     * @param baseCollegeId
     * @param courseTypeId
     * @param courseNature
     * @param flag
     * @param keyword
     * @param isSelect      4表示显示不选课和在线选课课程  5表示显示不选课和预选选课课程
     * @param isEnable
     * @return
     */
    List<Course> getCourseList(Integer taskId, String baseCollegeId, String courseTypeId, Integer courseNature, Integer flag, String keyword, Integer isSelect, Integer isEnable);

    /**
     * 获取设置课程环节参数列表
     *
     * @param page
     * @param taskId
     * @param baseCollegeId
     * @param courseTypeId
     * @param courseNature
     * @param flag
     * @param keyword
     * @param parameterSet
     * @return
     */
    SetCourseDto<Course> getCourseList(Page<Course> page, Integer taskId, Integer dataRange, String baseCollegeId, String courseTypeId, Integer courseNature, Integer flag, String keyword, Integer parameterSet);

    /**
     * 设置课程参数
     *
     * @param taskId
     * @param courseInput
     * @return
     */
    Boolean setCourseParams(Integer taskId, CourseInput courseInput);

    /**
     * 根据课程获取教学班
     *
     * @param taskId
     * @param courseId
     * @param keyword
     * @param teachingClassId
     * @return
     */
    PageInfo<TeachingClass> getTeachingClassByCourse(Integer taskId, Long courseId, Integer currentPage, Integer pageSize, Integer teachingClassType, String keyword, Long teachingClassId);

    /**
     * 根据课程获取培养方案
     *
     * @param taskId
     * @param courseId
     * @return
     */
    SetCourseDto<PlanTeaching> getPlanByCourse(Integer taskId, Long courseId, Integer campusId, Integer studyNature, String baseCollegeId, Integer flag);

    /**
     * 根据课程id自动分配教师
     *
     * @param taskId
     * @param courseId
     * @return
     */
    String autoMatchTeacher(Integer taskId, Long courseId);

//    /**
//     * 获取指定年级对应的行政班列表
//     *
//     * @param taskId
//     * @param collegeId
//     * @param gradeId
//     * @return
//     */
//    String phyClassList(Integer taskId, Long collegeId, Long gradeId);

    /**
     * 获取课程参数设置个数
     *
     * @param taskId
     * @return
     */
    CourseParameterSetVo getCourseParameterSetVo(Integer taskId);

    /**
     * 获取侧边栏课程环节列表
     *
     * @param taskId
     * @param baseCollegeId
     * @param keyword
     * @return
     */
    List<CourseTreeVo> getCourseTree(Integer taskId, String baseCollegeId, String keyword);

    List<Course> getCourseType(Integer taskId, String baseCollegeId);

    List<Integer> getCourseNature(Integer taskId, String baseCollegeId, String courseTypeId);

    void exportCourseInformation(HttpServletResponse response, Integer taskId, String courseName, String collegeName, String courseName1, String courseType, String courseNatureName, String selectStudentNums, String state, String isCourseState, String baseCollegeId, String courseTypeId, Optional<Integer> courseNature, String keyword, Optional<Integer> isEnable, Optional<Integer> isAchieveOpen, Integer pageSize, Integer currentPage);

    void importCourseInformation(HttpServletResponse response, Integer taskId, Integer flag, MultipartFile file);

    List<Course> getCourseLimit(Integer taskId);

    void copyCourseLimit(Integer taskId, List<Course> preCourse);
}
